package com.jcp.config;

import java.io.FileWriter;
import java.io.IOException;
import java.util.ResourceBundle;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	// ↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息
	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016101300673268";

	// 商户私钥，您的PKCS8格式RSA2私钥
	public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCjw3dLQ5uZAZNxEH/ZjBrn8WLSc5ES8rD5jH8rUALFt6qwKCf0ESw8Ae+hB5mKG8wGVaWn+/d7PReLctj7liWDVUcC025BxSz+qdv0Pczcxl5HNDcb0Q0cQ11Y6VD61sVRo3QmtCJWnkmfIR8zfBsqJOVaRB/yHj2TcJFoP9i29AJSxoRJHPs/6tDlE2pM5o48O4vx54z1chCjgu1xaUhiqMG7w2SU52YYG4GMXu/qelySvfT6+KJN/octTe5PB1kBpUCprSn+gFEOZzshFQSRzDcDCzWQTw1Aqp01n3n6VIVAMmsj0IaFimRiK1YKRXFd4GAxDwiNiP8v2KqpkJnLAgMBAAECggEASolcEbiq6IBMIIkW9+iKEonOpeUN4ebuYBbvhsI7EMzg9p7AWJk8Xe+vpsZzvuWZ/kQbSxMm+EO9JK5YTmJvnpBA6uta4rqhGSQsxcUfKllrbdM5RgLnibarlR1Uy2bXlqnj4v3YJz6SWchUkDVrk8oJTgV12NikxCfXNvDgbZxz1RIfmbeWBmq1DRmMjydb/pjyviSzByQFm71SN8BD0LaAdg4TdTbFF6nblc1izG7j/5Ar7wa2JFNgnE2VGCFYHLxp/AS9QH2s3SVgoV+S5RnNx2aIGNxw28o2GhIpi1VwD6x2IqHDD6ii3x1zAvX0lvFDOKsMRabpXuN13NIlCQKBgQDs9GClrSNs+cDLO1NqDoQg8yZ6dRG9oHubXvY8EPkAbWM1f57XTk1ys97N+2v7YKdditAVO2eYc1tL7KdxbCbOSAXEeyzkb8CkOnD9dkBpCu1t/VB8oXOpMBAfh+yCqZU1rPSBolSRVvMcvBBe+SgEssmpcDF9Qniv+Y/p5E8EfQKBgQCw7RhtF9uoS6Iio2/YfBMMYjYs/ADSmmSJRDcpmthjNPmaGVzmBbnmXCcu/8NpuNT1NX/e+5gIFfZXsDNnrpTputzm7ry/nvp4FT64TR5/mCqEHR0E7O4RedJAMV2goWLkzWqcMjGT95tnRJuyoxUI71GjYkLMTDq0nyTC3LhR5wKBgHfG8DPPWWD0vqf8zSWHQPMG9iRgmR8pyFG5pu6mBbhZkxSv9jMPucaJdc7ZkLP5H6EBUj3pUWyWo0e10M5cxSDw9zliqkau1sotYIA/DkAK7gnzSoQ1eKnFSeEmbD+ASZRgYRhGXkk5kpqr1fqsJ7Z4ScgEln+i4i7SEBVC+05hAoGAG5UK7s7+XpFT+IR0RlKpgY+6FG9BDZQmQkQROXo7a9PxabW0huOzpJcPQMN8ynmXMZcilTex7ujFm8wLZ4mPC5UnJRVo9ZKqR5hAS+kx7QBi+G+1e3QYdT8BqSJJD2a5jSP9D9a/Zer/Hi1S/JlyCQ+OMaN6+HCV4lzBFWPllFcCgYEA19+3p4VE4zg6wjhLcTUK5/rv3+5aVD4mb9RXyQSSSW7lY/k1dv901sbcPUFBmFFzu0WVTKSz8kclbJqToQGDYNHFbQIphTephYLnJ6yfcu5aVYAMuEbDyNL49QuGxO8H8jaf8cxcbVimiVRIbnHdIQGQpLeYVw1jyLRtp32LJBM=";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
	public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnXA5DFVw3eqDLyt9J6ST6DzcNVcMmpJUbcfZhOJ0fkkgYkXBwbcN6LHqF42FfDM2H03XsI3vdGoIM2sxJhHd5yGS5kzb4lnB6gfBq960Oh4Npupqe3Z/yelBM4rFdNHo2XLzfB8kTkpVSsPJJrP8FEiVJ24eBhqArx19AarGl4b+DWj1Qpzaa24Tev/lfdPRqW20x12BKTlA4qsYO1TUAyqN+I7w6PgydNCJOfh6zyGj0is2QDB35erWif1tyaKRaYIXoAjPK3synlruHOcMvTlw6JURpAObO8PqVT9Po3GTGZcG/Dy3fdWz5U5KNZLUBoXCUW+Uy8IXazWDmJvnQwIDAQAB";

	// 服务器异步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8090/JCP_PL/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	// public static String return_url = "http://localhost/JCP_PL/tiaoalibaba222";
	// public static String return_url = "http://localhost/JCP_PL/tiaoalibaba222";

	public static String return_url = "http://localhost:8090/JCP_PL/Tip2.jsp";
	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "E:\\alipayy";

	// ↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息
	/**
	 * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
	 * 
	 * @param sWord
	 *            要写入日志里的文本内容
	 */
	public static void logResult(String sWord) {
		FileWriter writer = null;
		try {
			writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
			writer.write(sWord);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

}